<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入layui -->
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <!-- 引入自己的 -->
    <link rel="stylesheet" href="/assets/article/art-list.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">文章列表</div>
        <div class="layui-card-body">
            <!-- 分类名称 -->
            <form id="form-filter" class="layui-form layui-form-pane" action="">
                <div class="layui-inline" pane>
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-inline">
                        <select name="cate_id" lay-verify="">
                            <option value="">请选择文章分类</option>
                        </select>
                    </div>
                </div>

                <!-- 状态名称 -->
                <div class="layui-inline" pane>
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-inline">
                        <select name="state" lay-verify="">
                            <option value="">请选择发布状态</option>
                            <option value="已发布">已发布</option>
                            <option value="草稿">草稿</option>
                        </select>
                    </div>
                </div>

                <!-- 提交按钮 -->
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">筛选</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

            <!-- 文章表格 -->
            <table class="layui-table">
                <colgroup>
                    <col width="150">
                    <col width="200">
                    <col>
                    <col>
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>文章标题</th>
                        <th>分类</th>
                        <th>发表时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
        </div>

        <!-- 表单模板 -->
        <script type="text/html" , id="art-list-tpl">
            {{each data}}
            <tr>
                <td>{{$value.title}}</td>
                <td>{{$value.cate_name}}</td>
                <td>{{$value.pub_date | formatTime}}</td>
                <td>{{$value.state}}</td>
                <td>
                    <button type="button" class="layui-btn layui-btn-xs">编辑</button>
                    <button type="button" data-id="{{$value.Id}}" class="layui-btn layui-btn-xs layui-btn-danger del-btn">删除</button>
                </td>
            </tr>
            {{/each}}
        </script>

        <!-- 分类列表模板 -->
        <script type="text/html" id="cate-list-tpl">
            {{each data}}
            <option value="{{$value.Id}}">{{$value.name}}</option>
            {{/each}}
        </script>

        <!-- 分页器 -->
        <div id="pagination"></div>
    </div>




    <!-- 引入 template -->
    <script src="/assets/lib/template-web.js"></script>
    <!-- 引入 layui-->
    <script src="/assets/lib/layui/layui.all.js"></script>
    <!-- 引入 jquery-->
    <script src="/assets/lib/jquery.js"></script>
    <!-- 引入 baseAPI -->
    <script src="/assets/js/baseAPI.js"></script>
    <!-- 引入 moment 插件 -->
    <script src="/assets/lib/moment.js"></script>
    <!-- 引入自己的 -->
    <script src="/assets/article/art-list.js"></script>
</body>

</html>